package cn.saltybe.analysis.crawler.wbtc.newHouse;

import com.geccocrawler.gecco.annotation.*;
import com.geccocrawler.gecco.request.HttpRequest;
import com.geccocrawler.gecco.spider.SpiderBean;

import java.util.List;

@Gecco(
        matchUrl = { "https://{}.58.com/xinfang/", "https://{}.58.com/xinfang/loupan/all/p{page}/" },
        pipelines = { "wbtcNewHouseListPipeline" },
        downloader = "htmlUnitDownloader")
public class WbtcNewHouseList implements SpiderBean {
    @Request
    private HttpRequest request;

    public HttpRequest getRequest() {
        return request;
    }

    public void setRequest(HttpRequest request) {
        this.request = request;
    }

    @Href(click = false)
    @HtmlField(cssPath = "#container > div.list-contents.theme58-listcontents > div > div.key-list.imglazyload > .item-mod > a")
    private List<String> houseList;

    @Text
    @HtmlField(cssPath = "#container > div.list-contents.theme58-listcontents > div > div.list-page > span > em")
    private String totalCount;

    @Text
    @HtmlField(cssPath = "#container > div.list-contents.theme58-listcontents > div > div.list-page > div > span.curr-page")
    private String currentPage;

    @Href(click = false)
    @HtmlField(cssPath = "#container > div.list-contents.theme58-listcontents > div > div.list-page > div > a.next-page.next-link")
    private String nextPageUrl;

    public String getNextPageUrl() {
        return nextPageUrl;
    }

    public void setNextPageUrl(String nextPageUrl) {
        this.nextPageUrl = nextPageUrl;
    }

    public String getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(String totalCount) {
        this.totalCount = totalCount;
    }

    public String getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(String currentPage) {
        this.currentPage = currentPage;
    }

    public List<java.lang.String> getHouseList() {
        return houseList;
    }

    public void setHouseList(List<java.lang.String> houseList) {
        this.houseList = houseList;
    }
}
